package com.jsonservlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import AMS.model.Stu;

import net.sf.json.JSONObject;

/**
 * Servlet implementation class jtest3
 */
public class jtest3 extends HttpServlet {
	private static final long serialVersionUID = 1L;
	
	Stu Student = new Stu();
	String StuId;
	JSONObject JsonObj = new JSONObject();
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public jtest3() {
        super();
        // TODO Auto-generated constructor stub
        
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		StuId = request.getParameter("StuId");
		int ActionNo = Integer.parseInt(request.getParameter("ActionNo"));
		String MasterCourse = request.getParameter("MasterCourse");
		String Content = request.getParameter("Content");
		
//		StuId = "96306090";
//		int ActionNo = 3;
//		String MasterCourse = "English";
//		String Content = "haha";
		
		Student.doAct(ActionNo,StuId,MasterCourse,Content);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request,response);
	}

}
